package com.soil.code.generation.infrastructure.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @auth zeno
 * @date 2022/7/31 20:15
 */
@Configuration
@MapperScan(basePackageClasses = BaseMapper.class,basePackages = "com.zeno.soil.codegeneration")
public class DataSourceConfig {

	@Bean(destroyMethod = "close")
	@ConfigurationProperties(prefix = "soil-code-generation.datasource")
	public DruidDataSource datasource(){
		return new DruidDataSource();
	}

}
